
cmake_minimum_required(VERSION 4.0.2)

# 设置项目名称及语言
project("can_native" CXX C)

# 设置C++标准
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 添加编译选项
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set(ANDROID_STL "c++_shared" CACHE STRING "STL library type")

# 添加源文件
add_library(
        can_native
        SHARED
        can_native.cpp
)

# 链接系统库（直接使用名称即可）
target_link_libraries(
        can_native
        log
        android
)

# 设置包含目录
target_include_directories(
        can_native
        PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}
)

# 添加编译定义
target_compile_definitions(
        can_native
        PRIVATE
        ANDROID
)